package org.libl.web.servlet.car;

import org.libl.dao.car.CarDao;
import org.libl.dao.car.impl.CarDaoImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/car/del")
public class delCarController extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{

        String car_id = request.getParameter("car_id");

        System.out.println(car_id);
        CarDao dao = new CarDaoImpl();
        int b = dao.del(car_id);
        System.out.println(b);
        response.setCharacterEncoding("utf-8");
        response.getWriter().write("成功");
//        request.setAttribute("pageBean",pageBean);
//        request.getRequestDispatcher("/student/page.jsp").forward(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
        doPost(request, response);
    }
}
